import React,{Component} from 'react';
import './column.css';
import HdbCell from "../../components/hdb-cell";
import {queryColumn} from "../../services/product";

export default class  Column extends Component{
    state={
        column:[]
    };

    async componentDidMount(){
        let res = await queryColumn();
        this.setState({column:res.data.data})
    }
    render(){
        let {column} = this.state;
        return (
            <div className="container">
                {
                    column.map((item,index)=>(
                        <HdbCell
                            key={item.id}
                            title={item.title}
                            label={item.des}
                            to={{pathname:`/detail/${item.id}`,search:{apiname:'column'}}}
                        />
                    ))
                }
            </div>
        )
    }
}